<template>
  <div>
    <el-dialog :visible.sync="dialogVisible" lock-scroll width="40%"
      :append-to-body="true">
      <div slot="title" class="header_title">
        <span class="title_span">{{ noticeData.titile }}</span>
      </div>
      <div class="content_div">
        <div class="info_table" v-html="noticeData.msgContent">
        </div>
        <div class="info_button">
          <el-button type="primary" @click="dialogVisible = false">关闭</el-button>
        </div>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import { mapGetters } from 'vuex'
export default {
  name: 'dialogNotice',
  computed: {
    ...mapGetters(['name']),
  },
  created() { },
  data() {
    return {
      dialogVisible: false, // 新增弹框
      noticeData: {},
    }
  },
  methods: {
    show(val) {
      this.noticeData = val
      this.dialogVisible = true
    },
  },
}
</script>

<style lang="scss" scoped>
::v-deep .el-dialog {
  width: 100%;
  padding: 28px 38px 58px 38px;

  .el-dialog__body {
    padding: 0;
  }

  .el-dialog__header {
    width: 100%;
    height: 0.937559rem;
    box-sizing: border-box;
    padding: 0 0.187512rem 0 0.281268rem;
    border-bottom: 1px solid #eeeeee;
    display: flex;
    align-items: center;
    justify-content: space-between;

    .el-dialog__headerbtn {
      position: static;

      .el-icon-close {
        color: #999;
        font-size: 0.48753rem;
      }
    }
  }

  .header_title {
    width: 100%;
    display: flex;
    align-items: center;

    .title_span {
      font-size: 16px;
      font-family: PingFang SC-Semibold, PingFang SC;
      color: #666;
      font-weight: 600;
      width: calc(100% - 20px);
      white-space: nowrap;
      text-overflow: ellipsis;
      overflow: hidden;
    }
  }
}

.content_div {
  width: 100%;
  height: 6.206638rem;
  background: #fff;
  box-sizing: border-box;
  padding: 0.187512rem 0.281268rem 0;

  .info_table {
    width: 100%;
    height: calc(100% - 1.312582rem);
    overflow: scroll;
    font-size: 12px;
    font-family: PingFang SC-Regular, PingFang SC;
    font-weight: 400;
    color: #666666;
    line-height: 25px;
  }

  .info_button {
    width: 100%;
    height: 1.312582rem;
    display: flex;
    align-items: center;
    justify-content: center;

    ::v-deep .el-button {
      width: 1.12507rem;
      height: 0.562535rem;
      display: flex;
      justify-content: center;
      align-items: center;
      border-radius: 0.093756rem;
    }
  }
}
</style>